//
//  DataBaseHandle.h
//  UI21_数据库练习
//
//  Created by dllo on 15/10/15.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <sqlite3.h>
@class ZBUserModel;

typedef NS_ENUM(NSUInteger, SelectUser) {
    InTable,
    NotInTable,
    SelectError,
};

typedef NS_ENUM(NSUInteger, loginType) {
    Normal,
    Weibo,
};

@interface DataBaseHandle : NSObject

{
    sqlite3 *dbPoint;
}

+ (instancetype)shareDataBaseHandle;

- (void)openDB;

- (void)creatTable;

// 查询用户是否在
- (SelectUser)isHaveInTable:(NSString *)str type:(loginType)type;

// 存储用户
- (void)saveUserInDB:(ZBUserModel *)user;

// 更新用户数据
- (void)upDateUserInDB:(ZBUserModel *)user type:(loginType)type;

- (ZBUserModel *)selectUser:(loginType)type str:(NSString *)str;

- (void)setTel:(NSString *)str tel:(NSString *)tel;

@end
